package com.sunshine.flutterappdemo.ui.activity.main

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.TextView
import com.sunshine.flutterappdemo.R
import io.flutter.embedding.android.FlutterActivity

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val helloWorld = findViewById<TextView>(R.id.tv_hello)
//        helloWorld.setOnClickListener {
//            startActivity(FlutterActivity.createDefaultIntent(this))
//        }

        helloWorld.setOnClickListener {
            startActivity(FlutterActivity.withNewEngine().initialRoute("/my_route").build(this))
        }
    }
}